package cn.springcloud.alibaba.core.base;

public class BaseResponse extends BasePojo {

	private int code;
	private String message;

	public BaseResponse() {

	}

	public BaseResponse(String message) {
		this.message = message;
	}

	public BaseResponse(int code, String message) {
		this.code = code;
		this.message = message;
	}

	public BaseResponse setResultCode(ResultCode resultCode) {
		this.code = resultCode.getCode();
		this.message = resultCode.getMessage();
		return this;
	}

	public int getCode() {
		return code;
	}

	public void setCode(int code) {
		this.code = code;
	}

	public String getMessage() {
		return message;
	}

	public void setMessage(String message) {
		this.message = message;
	}

	public boolean checkSuccess() {
		return code == 0;
	}

	public boolean unSuccess() {
		return code != 0;
	}
}
